import { createRouter, createWebHashHistory } from 'vue-router'
import { frontNavigationGuard } from '@/router/guards'
import Login from '@/views/login/Login.vue'
import Home from '@/views/home/Home.vue'
import AddHoliday from '@/views/home/components/add-holiday.vue'
import UpdatePass from '@/views/home/components/update-pass.vue'
import UpdatePassSuccess from '@/views/home/components/update-pass-success.vue'
import TodayStat from '@/views/home/components/today-stat.vue'

const routes = [
	{
		path: '/',
		component: Login,
		meta: {
			title: '登录',
		},
	},
	{
		path: '/home',
		component: Home,
		meta: {
			title: '主页',
		},
	},
	{
		path: '/addHoliday',
		component: AddHoliday,
		meta: {
			title: '新增请假',
		},
	},
	{
		path: '/updatePass',
		component: UpdatePass,
		meta: {
			title: '修改密码',
		},
	},
	{
		path: '/success',
		component: UpdatePassSuccess,
		meta: {
			title: '修改密码',
		},
	},
	{
		path: '/todayStat',
		component: TodayStat,
		meta: {
			title: '考勤统计',
		},
	},
]

const router = createRouter({
	history: createWebHashHistory(),
	routes,
})
frontNavigationGuard(router)
export default router
